package com.codechuan.hallo_internal.common;

import android.media.MediaPlayer;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.widget.Button;

import com.codechuan.hallo_internal.entity.CityInfo;
import com.codechuan.hallo_internal.entity.SuccessOrder;
import com.codechuan.hallo_internal.utils.ContextUtil;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.ExecutorService;

/**
 * @Deprecated 常量类
 */
public class Constant {
    // 地址
    public static String address;
    public static String app_version = "53";
    // 是否登录
    public static boolean is_login = false;
    // 开启防封
    public static  boolean open_ff = false;
    // 排除特惠
    public static  boolean PC_TH_CHECK = false;
    // 是否接单用的
    public static StringBuilder stringBuilder = new StringBuilder();
    // 订单列表
    public static StringBuilder orderList = new StringBuilder();
    public static ArrayList<SuccessOrder> ORDER_LIST = new ArrayList<>();
    public static MediaPlayer mediaPlayer;
    public static MediaPlayer mediaPlayerPK;
    // 到期时间
    public static String dq_time;

    // 主线程
    public static Handler handler;
    // 登录的账号信息
    public static String account;
    public static String token;
    public static String ticket;
    public static String keyNumber;
    // 城市信息
    public static CityInfo cityInfo;


    // 获取分辨率
    public static DisplayMetrics dm;

    // 是否启动
    public static boolean isStart = false;

    // 刷单接口
    public static boolean APP_IS_CHECK =  true; // app接口模式
    public static boolean XCX_IS_CHECK; // 小程序接口模式

    // 刷单模式
    public static boolean SN_ORDER; // 市内模式
    public static boolean CJ_ORDER; // 城际模式
    public static boolean XC_ORDER; // 行程模式

    // 订单排序规则
    public static boolean ZN_PX_CHECK = true;
    public static boolean ZZ_CHECK = false;
    public static boolean ZJ_CHECK = false;
    public static boolean ZG_CHECK = false;
    public static int SORT;

    // 起点位置
    public static String startAddress = "广东省深圳市宝安区";
    public static String SS_DW_ADDRESS = "广东省深圳市宝安区";

    // 接单模式
    public static boolean ZJ_DX = false; // 只接独享单
    public static boolean YD_GS = false; // 愿摊高速费
    public static boolean LX_QD = false; // 连续抢订单

    // 抢单定位
    public static boolean QD_DW = true;

    // 时间规则
    public static Date START_TIME ; // 工作接单开始时间
    public static String START_TIME_STRING = ""; // 工作接单开始时间字符串
    public static Date END_TIME ;// 工作接单结束时间
    public static String END_TIME_STRING = "";// 工作接单结束时间字符串

    // 订单金额规则
    public static Integer MIN_MONEY = 100; // 最小金额
    public static Integer MAX_MONEY = 9999; // 最大金额

    // 大厅订单起点/终点距离
    public static Integer DT_START_DES = 50;
    public static Integer DT_END_DES = 9999;

    // 行程订单终点/顺路度
    public static Integer XC_END_DES = 9999;
    public static Integer XC_SLD = 70;

    // 拼车选择框和拼车最小人数和最大人数代码区
    public static boolean PC_PERSON_CHECKBOX = true;
    public static Integer PC_MIN_NUMBER = 3;
    public static Integer PC_MAX_NUMBER = 4;


    // 独享选择框和独享最小人数和最大人数代码区
    public static boolean DX_PERSON_CHECKBOX = true;
    public static Integer DX_MIN_NUMBER = 1;
    public static Integer DX_MAX_NUMBER = 4;

    // 舒适选择框和舒适最小人数和最大人数代码区
    public static boolean SS_PERSON_CHECKBOX = false;
    public static Integer SS_MIN_NUMBER = 2;
    public static Integer SS_MAX_NUMBER = 4;

    // 指定城市
    public static ArrayList<String> cityCodeList = new ArrayList<>();
    public static boolean ZD_CS_CHECK = false;
    public static String ZD_CS_TEXT = "例如:深圳市,佛山市";

    // 排除城市
    public static boolean PC_CS_CHECK = false;
    public static String PC_CS_TEXT = "例如:深圳市,佛山市";


    // 获取订单类型
    public static String requestType; // 2市内 3城际
    public static String requestTypeParam;


    // 小程序订单接单使用的行程id
    public static  String SCHEDULE_ID ;

    // hallo版本信息
    public static String HALLO_VERSION = "6.76.5";
    public static String SDK_VERSION = "3.4.4";
    public static String RELEASE_VERSION = "6.63.0";
    public static String WECHAT_VERSION = "8.0.49";

    // 小程序接单需要用到的行程id
    public static String routeId;
    // 首页按钮
    public static Button button;
    // 主号失败次数
    public static int errorNumber;


    // 线程池
    public static ExecutorService executorService;

    // 实时定位选择框
    public static boolean SS_DW_CHECK_BOX = false;


    // 是否最新
    public static boolean is_zx = false;

    public static boolean isStartTask = false;


    public static String HOST_ADDRESS = "103.36.167.125";
    public static boolean isTxm = false;
//    public static String HOST_ADDRESS = "192.168.31.15";



    // 获取悬浮窗权限
    public static int getStatusBarHeight() {
        int result = 0;
        int resourceId = ContextUtil.application.getResources().getIdentifier("status_bar_height", "dimen", "android");
        if (resourceId > 0) {
            result =  ContextUtil.application.getResources().getDimensionPixelSize(resourceId);
        }
        return result;
    }

    public static SimpleDateFormat format;

}
